fix null value from get existing offering and service plan during binding failure#1716
Merged
Yavor16 merged 4 commits intocloudfoundry:masterfrom Oct 6, 2025
Merged
Conversation
b18b2f4 to
65a8b56
Compare
65a8b56 to
74d2380
Compare
theghost5800
reviewed
Oct 2, 2025
| CloudControllerClient client = context.getControllerClient(); | ||
|
|
||
| String serviceInstanceName = context.getVariable(Variables.SERVICE_TO_UNBIND_BIND); | ||
| if (serviceInstanceName == null) { |
Contributor
There was a problem hiding this comment.
Extract into a new method whole logic related with getting service instance name and avoid setting finalServiceInstanceName because it is little bit confusing to have 2 variables for the same thing.
|
|
||
| return serviceBindingJob -> context.getStepLogger() | ||
| .error(buildErrorMessage(app, serviceInstance, serviceInstanceName, serviceBindingJob)); | ||
| CloudServiceInstance serviceInstance = (serviceInstanceName != null) ? client.getServiceInstance(serviceInstanceName, false) : null; |
Contributor
There was a problem hiding this comment.
brackets can be omitted
theghost5800
reviewed
Oct 3, 2025
| if (serviceInstanceName == null) { | ||
| CloudServiceBinding serviceBinding = context.getVariable(Variables.SERVICE_BINDING_TO_DELETE); | ||
| if (serviceBinding != null) { | ||
| serviceInstanceName = client.getServiceInstanceName(serviceBinding.getServiceInstanceGuid()); |
Contributor
There was a problem hiding this comment.
I didn't notice up until now that this actually perform another call to the cf api, can you search for another way to retrieve service instance name, from different variable or pass service instance name from different process diagram. We are trying to avoid unnecessary http calls to the cf api because this increase chances to hit rate limit at user level.
theghost5800
approved these changes
Oct 3, 2025
Yavor16
approved these changes
Oct 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.